package com.example.museum.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.museum.entity.Employee;
import com.example.museum.mapper.EmployeeMapper;
import com.example.museum.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {


    @Autowired
    private EmployeeMapper employeeMapper;


    @Override
    public Page<Employee> getEmployeePage(long page, long size) {
        return null;
    }






    @Override
    public Employee login(Employee employee) {

        LambdaQueryWrapper<Employee> employeeLambdaQueryWrapper = new LambdaQueryWrapper<>();
        employeeLambdaQueryWrapper.eq(Employee::getUsername,employee.getUsername())
                        .eq(Employee::getPassword,employee.getPassword());
        Employee employeeLoogin = employeeMapper.selectOne(employeeLambdaQueryWrapper);

        return employeeLoogin;
    }
}
